package net.beeapm.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
  http://127.0.0.1:8101/hello/world?req=zhangsan
 *
 *

 java -javaagent:D:\dev\apm\sky-walking\apm-sniffer\apm-agent\target\skywalking-agent.jar -Dskywalking.agent.service_name=当前项目在skywalking显示的名称 -Dskywalking.collector.backend_service=xxxx:11800 -jar spring-demo-0.0.1-SNAPSHOT.jar
 java -javaagent:D:\dev\apm\sky-walking\apm-sniffer\apm-agent\target\skywalking-agent.jar -Dskywalking.agent.service_name=bee-apm-sb-demo -Dskywalking.collector.backend_service=cdh1:11800 -jar spring-demo-0.0.1-SNAPSHOT.jar
 -javaagent:D:\dev\apm\sky-walking\skywalking-agent\skywalking-agent.jar -Dskywalking.agent.service_name=apm-demo-Provider -Dskywalking.collector.backend_service=127.0.0.1:11800 -Dskywalking.agent.service_name=apm-demo-Provider
 -javaagent:D:\dev\apm\sky-walking\skywalking-agent\skywalking-agent.jar -Dskywalking.agent.service_name=apm-demo-Provider -Dskywalking.collector.backend_service=cdh1:11800 -Dskywalking.agent.service_name=apm-demo-Provider

 */
@SpringBootApplication
@MapperScan("net.beeapm.demo.mapper")
public class Application extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		application.initializers(new DemoInitializer());
		return application.sources(Application.class);
	}

	public static void main(String[] args) throws Exception {
		SpringApplication springApplication = new SpringApplication(Application.class);
		springApplication.addInitializers(new DemoInitializer());
		springApplication.run(args);
	}

}
